<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增用户账户信息')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-acctinfo-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">用户名：</label>
            <div class="col-sm-8">
                <select name="userName" class="form-control m-b" id="ele">
                    <option value="">所有</option>
                </select>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">ETC 账户名：</label>
            <div class="col-sm-8">
                <input name="accerName" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">ETC 账户号：</label>
            <div class="col-sm-8">
                <input name="acctId" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">订单号：</label>
            <div class="col-sm-8">
                <input name="orderId" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">手机号：</label>
            <div class="col-sm-8">
                <input name="phone" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">车架号：</label>
            <div class="col-sm-8">
                <input name="vin" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">车牌号：</label>
            <div class="col-sm-8">
                <input name="plateNo" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">秘钥：</label>
            <div class="col-sm-8">
                <input name="accerKey" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">SN号：</label>
            <div class="col-sm-8">
                <input name="obuSn" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">卡号：</label>
            <div class="col-sm-8">
                <input name="icNumber" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">银行id：</label>
            <div class="col-sm-8">
                <input name="beanId" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">预开户主键ID：</label>
            <div class="col-sm-8">
                <input name="preDataId" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工行e钱包账户号：</label>
            <div class="col-sm-8">
                <input name="ebagNo" class="form-control"  type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">ETC状态：</label>
            <div class="col-sm-8">
                <select name="accerStatus" class="form-control m-b">
                    <option value="7"> ETC申请-审核通过</option>
                    <option value="6">ETC申请-审核不通过</option>
                </select>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否删除：</label>
            <div class="col-sm-8">
                <select name="isDelete" class="form-control m-b">
                    <option value="0">不删除</option>
                    <option value="1">删除</option>
                </select>

            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "acctinfo/acctinfo"
    $("#form-acctinfo-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-acctinfo-add').serialize());
        }
    }
    $(function(){
        func();
    });
    function func() {
        $.ajax({
            type: "POST",
            url: "/third-system-service/acctinfo/acctinfo/userlist",
            success: function (data) {

                var vaule = data.total;

                if (vaule > 0) {
                    datas = data.rows;

                    var optionstring = "";
                    for (var j = 0; j < datas.length; j++) {
                        console.log(datas[j].userName);
                        optionstring += "<option value=\"" + datas[j].userName + "\" >" + datas[j].userName + "</option>";
                    }

                    $("#ele").html(optionstring);
                } else {
                    alert("暂无文件选择，请先上传文件！")

                    $("#ele").html("<option value=''>暂无</option>");

                }
            }
        });
    }

</script>
</body>
</html>